import React from 'react';
import {
  Image,
  View,
  Text,
  TouchableOpacity,
  ScrollView,
  KeyboardAvoidingView,
  Platform,
  TextInput,
} from 'react-native';
import styles from './style';

const LikeInput = (props) => {
  const [val, setVal] = React.useState('');
  return (
    <KeyboardAvoidingView
      behavior={Platform.OS === 'ios' ? 'padding' : ''}
      style={styles.bottom}>
      <View style={styles.input_box}>
        <TextInput
          value={val}
          onChangeText={(_val) => setVal(_val)}
          style={styles.input}
          placeholder="请输入"
        />
      </View>
      <TouchableOpacity
        onPress={() => {
          props.onSend(val);
          setVal('');
        }}
        activeOpacity={1}
        style={styles.img_contaienr}>
        <Text>发送</Text>
      </TouchableOpacity>
    </KeyboardAvoidingView>
  );
};

export default LikeInput;
